﻿<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@Model.Title</title>
    @Include("Head", Model)
    <script type="text/javascript" src="/Scripts/jquery.tmpl.js"></script>
    <script type="text/javascript" src="/Scripts/pageBar.js"></script>
    <script type="text/x-jquery-tmpl" id="tmpResult">
        <li>
            <span class="r">${AddTime}</span><a href="${Url}" target="_blank">${Title}</a>
        </li>
    </script>
    <script type="text/javascript">
        $(function () {
            //加载搜索列表
            loadList(1);
        });

        //加载搜索列表方法
        function loadList(pIndex) {
            //获取url中的所有参数
            var params = getUrlVars();
            var keywords = unescape(params[params[0]]);
            $.post('/Admin/Article/FullTextSearch', { 'pageIndex': pIndex, 'keywords': keywords }, function (jsonData) {
                if (jsonData.Status == '1') {
                    $('#ulResult').empty();
                    makePageBar(loadList, document.getElementById('pageBar'), jsonData.Data.PageIndex, jsonData.Data.PageCount, jsonData.Data.PageSize, jsonData.Data.RowCount);
                    $('#tmpResult').tmpl(jsonData.Data.Data).appendTo('#ulResult');
                }
            }, 'json');
        }

        //获取Url参数方法
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
                hash = hashes[i].split('=');
                vars.push(hash[0]);
                vars[hash[0]] = hash[1];
            }
            return vars;
        }
    </script>
</head>
<body>
    @Include("Top", Model)
    @Include("SubBanner", Model)
    <div class="Sub_Middlecon">
        <div class="Sub_Middle">
            @Include("Left", Model)
            <div class="SubMid_R">
                <div class="SubMid_R1">
                    <span class="SubMid_R1title">搜索结果</span><span class="SubMid_R1tip"></span>
                    <span class="SubMid_R1path">网站首页：<a href="/Html/Index.html">首页</a> - <span class="SubMid_R1current">搜索结果</span></span>
                </div>
                <div class="SubMid_R2">
                    <div class="SubMid_ArticleListcon">
                        <ul id="ulResult"></ul>
                    </div>
                </div>
                <div class="SubMid_R3">
                    <div class="SubMid_R3con">
                        <div id="pageBar"></div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    @Include("Foot", Model)
</body>
</html>